
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
    <title>商品列表</title>
    <link rel="stylesheet" href="css/commm.css">
    <link rel="stylesheet" type="text/css" href="font/iconfont/iconfont.css">
    <link rel="stylesheet" href="css/details.css">
    <link rel="stylesheet" href="css/getmoneyctrl.css"/>
    
    <style>
      .shopnav ul li{
        text-align:center;
      }
    </style>
</head>
<body>
  <header  class="header" id="fanhui">
    <div class="top clearfix">
      <a href="#" class="fanhui">&lt;</a>
      <h2>商场导航</h2>
      <div class="hd"><img src="images/header_app.png" alt=""></div>
    </div>
  </header>
      
    <div class="shopnav">
      <ul id="shopnav">
        <a href="">
          <li><img src="" alt=""></li>
        </a>
      </ul>
    </div>

    <script src="js/jquery.js"></script>
    <script src="js/template.js"></script>
    <script type="text/html" id="get-nav">
    {{if result}}
    {{each result as value}}
            <a href="{{value.navHref}}">
          <li><img src="{{value.navImg}}" alt="">{{value.navTitle}}</li>
        </a>
      {{/each}}
    {{/if}}
    </script>

<script>
  $(function(){
    $.ajax({
      url:"http://192.168.23.25:3000/api/getsitenav",
      type:'get',
      datatype:'jsonp',
      success:function(data){
          var html = template("get-nav",data);
          $("#shopnav").html(html);
      }
    })
  })
</script>
</body>
</html>
